import request from '@/utils/request'
/**
 * 小程序管理
 * @see {@link http://ps.jibachuan.com/platform/swagger-ui.html#!/wx-order-controller}
 * @see {@link http://ps.jibachuan.com/platform/swagger-ui.html#!/wx-subject-controller}
 * @see {@link http://ps.jibachuan.com/platform/swagger-ui.html#!/wx-voucher-controller}
 * @see {@link http://ps.jibachuan.com/platform/swagger-ui.html#!/wx-banner-controller}
 * @see {@link http://ps.jibachuan.com/platform/swagger-ui.html#!/wx-category-set-controller}
 * @see {@link http://ps.jibachuan.com/platform/swagger-ui.html#!/wx-member-controller}
 */
const orderMod = '/wx-order'
const subjectMod = '/wx-subject'
const voucherMod = '/wx-voucher'
const bannerMod = '/wx-banner'
const categoryMod = '/wx-category'
const memberMod = '/wx-member'

/**
 * [query 查询订单]
 */
export function queryOrder(params) {
    return request({
        url: `${orderMod}/query`,
        method: 'get',
        params
    })
}

/**
 * [detail 查询订单详情]
 */
export function getOrderDetail(data) {
    return request({
        url: `${orderMod}/detail`,
        method: 'post',
        data
    })
}

/**
 * [query 查询栏目]
 */
export function querySubject(params) {
    return request({
        url: `${subjectMod}/query`,
        method: 'get',
        params
    })
}

/**
 * [getById 查询栏目详情]
 */
export function getSubjectById(data) {
    return request({
        url: `${subjectMod}/getById`,
        method: 'post',
        data
    })
}

/**
 * [query 查询优惠券]
 */
export function queryVoucher(params) {
    return request({
        url: `${voucherMod}/query`,
        method: 'get',
        params
    })
}

/**
 * [query 查询首页banner图]
 */
export function queryBanner(params) {
    return request({
        url: `${bannerMod}/query`,
        method: 'get',
        params
    })
}

/**
 * [query 查询品类]
 */
export function queryCategory(params) {
    return request({
        url: `${categoryMod}/query`,
        method: 'get',
        params
    })
}

/**
 * [getById 获取品类组详情]
 */
export function getCategoryById(data) {
    return request({
        url: `${categoryMod}/getById`,
        method: 'post',
        data
    })
}

/**
 * [getById 获取会员详情]
 */
export function getMemberById(data) {
    return request({
        url: `${memberMod}/getById`,
        method: 'post',
        data
    })
}